package com.rk.kbk.model;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.rk.kbk.common.DateJsonDeserializer;
import com.rk.kbk.common.DateJsonSerializer;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import javax.persistence.*;

/**
 * @WorkLog
 * @骑手请假(work_log)
 * @version : Ver 1.0
 */
@Entity
public class WorkLog implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * @备注:
	 * @字段:id BIGINT(19)
	 */
	@Id
	@GeneratedValue(strategy= GenerationType.IDENTITY)
	@GenericGenerator(name="auto-identity",strategy="identity")
	@Column(updatable = false, columnDefinition="BIGINT(19) COMMENT ''")
	private java.lang.Long id;

	/**
	 * @备注:骑手id
	 * @字段:ride BIGINT(19)
	 */
	@ManyToOne
	@JoinColumn(name="ride", columnDefinition="BIGINT(19) COMMENT '骑手id'")
	private User ride;

	/**
	 * @备注:是否工作,1表示开启工作,2表示休息
	 * @字段:is_work INT(10)
	 */
	@Column(columnDefinition="INT(10) COMMENT '是否工作,1表示开启工作,2表示休息'")
	private java.lang.Integer isWork;

	/**
	 * @备注:默认1表示正常,2表示异常
	 * @字段:status INT(10)
	 */
	@Column(columnDefinition="INT(10) COMMENT '默认1表示正常,2表示异常'")
	private java.lang.Integer status;

	/**
	 * @备注:创建时间
	 * @字段:gmt_datetime DATETIME(19)
	 */
	@Column(updatable = false, columnDefinition="DATETIME(19) COMMENT '创建时间'")
	@JsonSerialize(using=DateJsonSerializer.class)
	@JsonDeserialize(using=DateJsonDeserializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss" )
	private java.util.Date gmtDatetime = new java.util.Date();

	/**
	 * @备注:修改时间
	 * @字段:upt_datetime DATETIME(19)
	 */
	@Column(columnDefinition="DATETIME(19) COMMENT '修改时间'")
	@JsonSerialize(using=DateJsonSerializer.class)
	@JsonDeserialize(using=DateJsonDeserializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss" )
	private java.util.Date uptDatetime = new java.util.Date();

	public WorkLog(){
	}

	public WorkLog(
		java.lang.Long id
	){
		this.id = id;
	}



	public void setId(java.lang.Long id) {
		this.id = id;
	}

	public java.lang.Long getId() {
		return this.id;
	}

	public User getRide() {
		return ride;
	}

	public void setRide(User ride) {
		this.ride = ride;
	}

	public void setIsWork(java.lang.Integer isWork) {
		this.isWork = isWork;
	}

	public java.lang.Integer getIsWork() {
		return this.isWork;
	}


	public void setStatus(java.lang.Integer status) {
		this.status = status;
	}

	public java.lang.Integer getStatus() {
		return this.status;
	}


	public void setGmtDatetime(java.util.Date gmtDatetime) {
		this.gmtDatetime = gmtDatetime;
	}

	public java.util.Date getGmtDatetime() {
		return this.gmtDatetime;
	}


	public void setUptDatetime(java.util.Date uptDatetime) {
		this.uptDatetime = uptDatetime;
	}

	public java.util.Date getUptDatetime() {
		return this.uptDatetime;
	}
}
